var path = require('path')

// var webpack = require('webpack')

// var HtmlWebpackPlugin = require('html-webpack-plugin')//create html
// var ExtractTextPlugin = require('extract-text-webpack-plugin')//extract css

module.exports = {
    entry: {
        main: './src/main.js',
        vendor: ['vue']
    },
    output: {
        path: path.join(__dirname, 'dist'),
        publicPath: '/dist',
        filename: '[name].js'
    },
    module: {
        rules: [
            {
                test: /\.vue$/,
                loader: 'vue-loader'
            },
            {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: /node_modules/
            },
            {
                test: /\.css$/,
                loader: 'style!css!less-loader'
            },
            {
                test: /\.(gif|jpg|png|woff|svg|eot|ttf)$/,
                loader: 'url-loader?limit=8192'
            },
            {
                test: /\.html$/,
                use: 'vue-html-loader'
            },
            {
                test: /\.tpl/,
                use: 'vue-template-compiler-loader'
            },
            // {
            //     enforce: 'pre',
            //     test: /\.(vue|js)$/,
            //     loader: 'eslint-loader',
            //     exclude: '/node_modules'
            // },
        ]
    },
    // plugins: [
    //     new webpack.HotModuleReplacementPlugin(),
    //     new webpack.optimize.CommonsChunkPlugin({
    //         name: 'vendor'
    //     }),
    //     // new ExtractTextPlugin("[name].css", { allChunks: true, resolve: ['modules'] }),
    //     // new HtmlWebpackPlugin({
    //     //     filename: "index.html",
    //     //     template: 'index.tpl'
    //     // })//something wrong here
    // ],
    devServer: {
        // contentBase: path.join(__dirname, "out"),
        // compress: true,
        port: 9000
    }
}
